package org.frankkie.zooi;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.os.Bundle;
import android.widget.Button;
import android.widget.Toast;
import java.io.PrintStream;

/**
 * ParcDroid, MainActivity
 * Hier begint de App
 * @author frankkie
 */
public class MainActivity extends Activity {

  static Context deContext;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    System.setErr(new PrintStream(new SystemOut("System.err")));
    System.setOut(new PrintStream(new SystemOut("System.out")));
    System.out.println("ParcDroid.MainActivity");
    // ToDo add your GUI initialization code here
    this.setContentView(R.layout.main);
    Button knopNaarGPS = (Button) findViewById(R.id.knopjeGPS);
    deContext = this.getApplicationContext();
    knopNaarGPS.setOnClickListener(new OnClickListener() {

      public void onClick(View arg0) {
        try {
          System.out.println("GEKLIKT OP DE GPS-KNOP !!");
          //android.widget.Toast.makeText(getApplicationContext(), "Geklikt", Toast.LENGTH_LONG);
          //startActivity(new Intent("org.frankkie.parcdroid.GPSActivity"));
          //new GPSActivity();
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    });
  }
}
/////////////////////
//Zooi Code
/////////////////////
/*
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); //getCurrentLocation("gps");
GpsStatus gpsStatus = locationManager.getGpsStatus(null);
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
System.out.println("Provider is Enabled");
} else {
System.out.println("Provider is not Enabled");
}
System.out.println("GPSSTATUS");
System.out.println(gpsStatus.getMaxSatellites());
System.out.println(gpsStatus.getTimeToFirstFix());
////
System.out.println("LOCATION");
System.out.println(location.getAccuracy());
System.out.println(location.getAltitude());
System.out.println(location.getBearing());
System.out.println(location.getExtras());
System.out.println(location.getLatitude());
System.out.println(location.getLongitude());
System.out.println(location.getProvider());
System.out.println(location.getSpeed());
System.out.println(location.getTime());
System.out.println(location.hasAccuracy());
System.out.println(location.hasAltitude());
System.out.println(location.hasBearing());
System.out.println(location.hasSpeed());
//location.dump((Printer) System.out, "LOL:\n");
 */
